package org.link.web;

import javax.annotation.Resource;

import org.link.bean.User;
import org.link.service.IUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UserController {

	@Resource
	private IUserService userService;
	
	@RequestMapping(value="/index",method=RequestMethod.GET)
	public String index(){
		return "index";
	}
	
	@RequestMapping(value="/addUser",method=RequestMethod.POST)
	public String addUser(User user){
		System.out.println(userService.addUser(user));
		return "/index";
	}
}
